home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _0FB1D073146C40778D6D18D28D2C6BFE < prev    next >
Encoding:
Text File  |  2004-01-06  |  960 b   |  37 lines

  1. // ===============================================================
  2. // Fragment Program: Invulnerability
  3. // Description: used in characters when in invulneability mode
  4. // Last Update: 02/09/2003
  5. // Coder: Tiago Sousa
  6. // ===============================================================
  7.  
  8.  
  9. #include "../CGVPMacro.csi"
  10.  
  11.  
  12. MainInput { uniform sampler2D bumpMap : texunit0,
  13.             uniform sampler2D refMap : texunit1, 
  14.             uniform float4 Matrix,
  15.             uniform float4 Amount
  16.           }
  17.  
  18. DeclarationsScript
  19. {
  20.   OUT_T0_T1
  21.   FOUT
  22. }
  23.  
  24. CoreScript
  25. {
  26.   // load the decal
  27.   float4 bumpColor = tex2D(bumpMap, IN.Tex0.xy);
  28.   float4 refrColor = offsettex2D(refMap, IN.Tex1.xy, bumpColor, Matrix);
  29.   
  30.   // get brightest color..
  31.   float fBrightest=dot(float3(0,1,0), refrColor.xyz);
  32.   fBrightest*=fBrightest;
  33.   fBrightest*=fBrightest;
  34.      
  35.   OUT.Color.xyz = fBrightest*Amount.w*Amount.xyz;
  36.   OUT.Color.w= fBrightest*Amount.w;
  37. }